package Assignment.Test5;

public class Test {
    //在测试类Test中创建A的对象a并调用成员方法methodA()
    public static void main(String[] args) {
        A a = new A();

        a.methodA(
                new InterA() {
                    @Override
                    public void showA() {
                        System.out.println("实现");
                    }
                }
        );

    }
}

interface InterA {
    void showA();
}

class A {
    public void methodA(InterA a) {
        a.showA();
    }
}
